%table.table.table-striped.collection
  %thead
    %tr
      %th= t_attr :value_date, EsrRecord
      %th= t_attr :customer, EsrRecord
      %th= t_attr :state, EsrRecord
      %th.currency= t_attr :amount, EsrRecord
      %th.currency= t_attr :payment_amount, EsrRecord
      %th.currency= t_attr :saldo, EsrRecord

  - for esr_record in list_records
    %tbody
      %tr
        %td= esr_record.value_date
        %td= link_to esr_record.invoice.customer.to_s, esr_record.invoice.customer if esr_record.invoice
        %td= esr_record.invoice ? link_to(esr_record.remarks, esr_record.invoice) : esr_record.remarks
        %td.currency= currency_fmt(esr_record.invoice.amount.currency_round) if esr_record.invoice
        %td.currency= currency_fmt(esr_record.amount.currency_round)
        %td.currency= currency_fmt(esr_record.invoice.balance.currency_round) if esr_record.invoice
